package com.zut.subject.domain.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Collections;
import java.util.concurrent.*;

@Configuration
public class ThreadPoolConfig {

    @Bean(name = "labelThreadPool")
    public ThreadPoolExecutor getLabelThread(){
        return new ThreadPoolExecutor(10,20,2,
                TimeUnit.SECONDS,new LinkedBlockingQueue<>(40),
                Executors.defaultThreadFactory(),new ThreadPoolExecutor.CallerRunsPolicy());
    }
}
